1. Field of the Invention
The present invention relates to a fuzzy inference method. Particularly, it relates to a fuzzy inference method which enables a user to check for inconsistency among the fuzzy rules defined in a fuzzy inference.
2. Description of the Related Art
Below is described a prior art fuzzy inference method.
Fuzzy inference comprises executing a fuzzy operation in accordance with a fuzzy rule which was defined in advance for one or more inputs (inference rule, hereinafter referred to as rule) and then to output an operation result as an inference result.
Assuming that inputs are designated by x0, x1, x2 . . . and outputs are designated by y1, y2 . . . , the rule is represented in the following format
______________________________________ "IF x0 = A and x1 = B and x2 = A . . . "Then y1 = P, y2 = Q . . . Where the former part of the rule "IF x0 = A and x1 = B and x2 = A . . ." is called an antecedent, and the latter part "Then y1 = P, y2 = Q . . ." is called a consequent. This rule means that if x0 is the value of A, x1 is the value of B, x2 is the value of A, and so forth at the same time, the value of P as y1, the value of Q as y2, and so forth are outputted. ______________________________________
The values of A, B, P, Q, and so on are called fuzzy variables of the rule. These fuzzy variables are defined not as a single value but as a triangular or bell shape function designating a grade as shown in a graph of FIG. 1.
In FIG. 1, the horizontal axis designates the input value or output value, and the vertical axis designates the grade. Two fuzzy variables of A and B for the variable x1 are shown in FIG. 1. In the case where the value of variable x1 is x11, for example, the grades for the fuzzy variables A and B are designated by sb1 and sb1, respectively. In the case where the value of the variable x1 is x12, the grades for the fuzzy variables A and B are designated by 0 and sb2, respectively. The fuzzy logic, the description "x1=A" is evaluated not by two values showing the fact that the description is true or false but by successive values called grades. The function defining such grades is called a membership function.
It is not necessary to limit the number of equations EQU "x1=A", "x2=B", "x3=A"
in the antecedent and EQU "y1=P" "y1=Q"
in the consequent to the specific example given above. Hereinafter, an example according to the present invention includes two descriptions in the antecedent and one description in the consequent of the rule.
There are several well-known methods of the fuzzy inference, one of which called the min-max-centroid method. In the methods of making a fuzzy inference using the min-max-centroid method, an operation in accordance with the above described rule is employed.
For example, as shown in FIG. 2, an inference in accordance with the following two rules is made as follows. EQU IF x1=A and x2=B Then y=P (Rule 1) EQU IF x1=C and x2=D Then y=Q (Rule 2)
First, for the description of "x1=A" in the antecedent of the rule 1, in accordance with a membership function defining A, the grade s11 defines how much of input x1 results. In the same way, for the description of "x2=B", grade s12 designates how much the input x2 is adapted to B. And, in accordance with the "and" operation, the grade of the smaller value of grades s11 and s12 is selected and the result designated s1. The grade s1 becomes the adaptation for the rule 1.
As in the same way, for the rule 2, for the description of "x1=c", the grade s21 of the input x1 for C is obtained, and for the description of "x2=D", the grade s22 of the input x2 for D is obtained, respectively, out of which the grade of a smaller value is selected by the minimum operation and is designated s2.
Processing to obtain the consequent of the rule is performed as follows.
In the consequent, function H1 can be visualized as the part left by excluding a portion greater than the grade s1 to obtain membership function G1 defining the fuzzy variable P in accordance with the description of "y1=P" of the rule 1. In a similar manner, function H2 can be defined as a portion remaining after excluding portions greater than grade s2 to obtain the membership function G2 defining the fuzzy variable Q.
A resultant function F is created by selecting the greater value of function H1 or function H2 at each value of y, resulting in F, an output membership function (this process is called maximum operation).
Function F is shown in the lowest right part of FIG. 2, wherein weighting of the grades of the rules 1 and 2 to the meanings of the rules 1 and 2 are depicted. In other words, in accordance with the rule 1, the central value P of the function G1 is specified to be outputted as y. However, the grade s1 of the rule 1 is relatively large as is shown in the figure. Then the resultant function H1 has a relatively minor truncation of peak values. On the other hand, in accordance with the rule 2, the central value q of the function G2 is specified to be outputted as y, and the grade s2 of the rule 2 is relatively small as is shown in the figure. Then function H2 has a highly truncated or flattened upper portion.
Accordingly, it is readily seen that the average value of the functions H1 and H2 may be employed as the final output value of y. In this case, however, the arithmetic average value of the functions H1 and H2 is not calculated by the min-max-centroid method, and the maximum operation is executed for the functions H1 and H2 to obtain the function F, and the center of gravity of the function F is made to be the average of the meanings of the both functions H1 and H2. In other words, such a center of gravity r of the function F as shown in FIG. 2 is an inference result which is equal to the output value of y.
The fuzzy inference in accordance with the min-max-centroid method is as described above. However, there is a need to evaluate validity of the inference result, that is, inconsistency in the defined rule. For example, there may be several cases of a combination of functions with the same central value r, such as the functions F1 and F2 shown in FIG. 3, and it is necessary to evaluate the shape of these functions.
Now will be referred to such two functions F1 and F2 as shown in FIG. 3.
First, for the function F1, there is a large distance between the two functions H11 and H12 which are objects of the maximum operation, and the both functions have relatively large maximum values. This means that a rule 11 and a rule 12 which lead the functions H11 and H12, respectively have inconsistent meanings with each other. In other words, in the case where input is in such a state as shown in FIG. 3, p1 is specified to be outputted as the y in accordance only with the rule 11 and q1, is specified to be outputted only in accordance with the rule 12. In this case, needless to say, it is possible to obtain the center of gravity r of the function F1 as the inference result. However, r falls between the two rules; it is insufficient in such a case to merely calculate the intermediate value of the requests of the two inconsistent rules since the reliability of this value is extremely low.
On the other hand, referring to function F2, there is a relatively small distance between the two functions H21 and H22 which are objects of the maximum operation. However, function H21 has substantially a smaller maximum value in comparison with the function H22. In this case, a rule 21 and a rule 22 which lead both the functions H21 and H22, respectively, specify outputs p2 and q2, respectively. Input conditions being adapted to those rules are different, then, it does not necessarily mean that those rules are inconsistent. This is because the input state as shown in FIG. 3 is completely adapted to the antecedent of the rule 22 but is only loosely adapted to the antecedent of the rule 21, e.g., only slightly affected. Accordingly, an instruction of the rule 22 greatly reflects upon its output and an instruction of the rule 21 hardly reflects upon its output. In other words, it means that there is no problem in the case where the two rules specify to output different values, respectively.
As may be seen from the above description, there exists the case where meanings of the two rules are inconsistent in the fuzzy inference, then, it is necessary not only to make the combined reference but also to detect inconsistency in the rules defining the inference.
As an example of the fuzzy inference apparatus for detecting such inconsistency in the rules, there is known one in Japanese Patent Application Laid-Open No. 61-264411 (1986). Now will be described in brief below the method of detecting inconsistency in fuzzy rule which is disclosed in above-mentioned Japanese Patent Application Laid-Open No. 61-264411 (1986) with reference to FIG. 4 of its schematic illustration.
According to the method disclosed in the Japanese Patent Application Laid-Open No. 61-264411 (1986), in the case where the finally obtained membership function has two or more larger peaks, it is decided that the rules are inconsistent. According to the method wherein, the largest peak value of the membership function is g.sub.M1, the second largest peak value is g.sub.M2, and the minimum value of the membership function between these peaks is l.sub.1 as shown in FIG. 4, then if ##EQU1## (normally, constant rg=1), it is concluded that there are two or more large peaks.
In other words, the above two equations are the index to show how large the second peak is compared with the first peak, accordingly, it is decided whether or not there are two or more peaks by evaluating these equations.
However, such a method of detecting inconsistency in rules as disclosed in the above-mentioned Japanese Patent Application Laid-Open No. 61-264411 evaluates only the relationship of magnitude between the peaks of the membership function. This means that the method evaluates the vertical axis of the membership function alone but it takes no horizontal axis into its consideration. Then, in the case where there are two membership functions which have peaks of the same heights and different distances as shown in FIG. 5(a) and FIG. 5(b), for example, it is not possible to distinguish the case, shown in FIG. 5(a) from the case shown in FIG. 5(b). In other words, the functions which are shown in FIG. 5(a) and FIG. 5(b) have the same values in g.sub.M1, g.sub.M2 and l.sub.1 as well as the equation EQU (g.sub.M2 -l.sub.1)/(g.sub.M1 -g.sub.M2).ltoreq.1
is established in the both functions.
As a result, according to the method disclosed in the abovementioned Japanese Patent Application Laid-Open No. 61-264411, it is decided that there is no inconsistency in the rules. However, it should be decided that there is relatively little inconsistency in the case shown in FIG. 5(a) but there is a large inconsistency in the case shown in FIG. 5(b) because it is apparently seen that the two rules specify to output largely different values.
As mentioned above, in such a method of detecting inconsistency in rules as disclosed in the Japanese Patent Application Laid-Open No. 61-264411, there is a problem that even in the case where it is valid to decide that there is inconsistency in the rules, it is not possible to detect it. In other words, it can be said that precision in detecting inconsistency in the rules is low.